Executive Summary

An analysis based on linear regression is carried on determining whether a manual or an automatic transmission has an impact on Miles per Gallon (MPG). The data analysis points to the construction of two linear models . One model predicts MPG with the type of transmission, while the other one predicts it using the weight of a car plus the type of transmission. From the models, we conclude that an automatic or manual transmission has zero to none impact on MPG performance. Several tests were applied to establish the robustness of the models.

Introduccion

This report describes a linear regression approach to determine whether the type of transmission (manual or automatic) has an impact on Miles per Gallon (MPG). The approach should also find an answer to the following question: Is an automatic or manual transmission better for MPG? Understanding the impact of the type of transmission on MPG can help manufacturers to determine whether to equip more cars with manual or automatic transmissions to improve MPG performance.

The data for the analysis comes from the 1974 Motor Trend US magazine. It comprises fuel consumption and 10 aspects of automobile design and performance for 32 automobiles (1973–74 models).

Exploratory Data Analysis

MPG is used as a measure of car performance. An automobile with 24 MPG is going to be less efficient than one with 30 MPG. The reason lies in the fact that a lower MPG indicates that a car will use less fuel per mile.

The transmission of a car makes it possible to change gears, controlling the transfer of power to the rear tires of the vehicle. “There are two types of transmissions: manual and automatic […]. In manual transmissions, gear selection is made manually with a gear shift, and coupling and engaging are done using a clutch. In the automatic transmission, on the other hand, everything is done automatically, and the clutch is replaced by a torque converter”[1]

The difference between a manual and an automatic transmission rest on how the gears are shifted, and not on a different set of gears employed. Thus, we should not expect a difference in MGP performance between cars that employed a distinct transmission. Hence, a plot of the MPG variable against the transmission one should show no effect on MPG performance by either an automatic or manual transmission.

Contrary to our assumption, the data suggest a clear relationship between the type of transmission and MPG. Automobiles with an automatic transmission (“0”) have lower MPG on average than those with manual transmission (“1”). The data indicates that an automatic transmission has a negative impact on MPG.

First linear model

The exploratory data analysis points to a possible relation between the transmission type and MPG. A linear model should reveal the degree to which the type of transmission can predict MPG.

## 
## Call:
## lm(formula = mtcars$mpg ~ factor(mtcars$am), data = mtcars)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -9.3923 -3.0923 -0.2974  3.2439  9.5077 
## 
## Coefficients:
##                    Estimate Std. Error t value Pr(>|t|)    
## (Intercept)          17.147      1.125  15.247 1.13e-15 ***
## factor(mtcars$am)1    7.245      1.764   4.106 0.000285 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 4.902 on 30 degrees of freedom
## Multiple R-squared:  0.3598, Adjusted R-squared:  0.3385 
## F-statistic: 16.86 on 1 and 30 DF,  p-value: 0.000285

Our model shows that the expected MPG for cars with an automatic transmission is 17.147. The model also shows that there is an increase of 7.245 in MPG for cars with a manual transmission. Thus, cars with a manual transmission have an expected MPG of 24.392. The p-values of the coefficients tell us that the probability that the expected values are equal to zero is very low. Thus, the values have a higher probability of being accurate.

Nonetheless, a plot of the residuals of our model shows a clear patron (two lines). The fact that a visible patron can be found on the residuals is strong evidence that our model is not predicting MPG. This suggests that another variable may explain the relation between MPG and the transmission type found on the box plot.

Second linear model

Newton’s second equation of motion states Force = Mass (Weight) * Acceleration. Consequently, object A with a mass of 20 pounds will require less force to be moved than object B with 50 pounds of mass. This is relevant for our analysis because a heavier car would require more energy(fuel) to be moved. Hence, cars that are heavier than the average would have a lower MPG. Let´s confirm this hypothesis by plotting the variable MPG against the Weight one:

We can observe that there is a negative relation between MPG and weight. That is, an increase in the weight of a particular automobile decreases its MPG. Moreover, weight has a correlation of -8.8 with the MPG. Therefore, weight can be considered a good predictor of MPG. In light of these findings, we can reasonably conjecture that cars with an automatic transmission are on average heavier than those with a manual one in our data set.

As before, we can plot the weight variable against the transmission one to confirm our hypothesis.

The plot confirms our conjecture. The cars equipped with an automatic transmission are heavier on average that the ones with a manual one. Thus, a model adjusted by weight should show no impact on MPG based on transmission.

## 
## Call:
## lm(formula = mpg ~ wt + factor(am), data = mtcars)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -4.5295 -2.3619 -0.1317  1.4025  6.8782 
## 
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)    
## (Intercept) 37.32155    3.05464  12.218 5.84e-13 ***
## wt          -5.35281    0.78824  -6.791 1.87e-07 ***
## factor(am)1 -0.02362    1.54565  -0.015    0.988    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 3.098 on 29 degrees of freedom
## Multiple R-squared:  0.7528, Adjusted R-squared:  0.7358 
## F-statistic: 44.17 on 2 and 29 DF,  p-value: 1.579e-09

The second model shows that the average MPG on our data set is 37.29794. From the model, we can also infer that a loss of 5.35281 in MPG should be expected by a 1000 pounds increase in weight on a given car [2]. Finally, the model suggests that a decrease of 0.02362 in MPG can be expected with cars equipped with a manual transmission.

The last coefficient on our model appears to contradict our hypothesis that a model adjusted by weight should show that the type of transmission has no impact on MPG. Nonetheless, the p-values of the coefficient in question have a high probability (0.988) of being zero. Therefore, we can conclude with a high degree of confidence that MPG performance is independent of transmission type.

Let´s use a plot to have a graphical representation of the information provided to us by the coefficients and their p-values.

The plot above shows us the high correlation between MPG and Weight, as we have seen before, through a black line that points to a decrease in MPG with an increase in Weight. Moreover, the plot allows us to infer that type of transmission has no impact on MPG.

The dark blue dots(automatic), and pale ones(manual) “follow” the black line indicating that our lineal model explains the difference between MPG performance on cars with automatic and manual transmissions. Otherwise, the points would be “far” from the line.

Although the model explains most of the relation between MPG and transmission type, they are still points, “outliers”, which are “far” from the black line. For example, there are two pale blue dots whose MPG lies between 30 and 35, which are not explained by the model.

Nonetheless, the plot of the residuals versus MPG of the model shows no visible patron in it. Implying that our model is doing a job good of predicting MPG. Thus, the existence of outliers does not reduce significantly the performance of the model [3].

Conclusion

This analysis aims to establish if MPG is affected by the type of transmission of a car. A linear model was built to predict MPG based on two predictors: transmission type and weight. This led us to conclude with a high degree of confidence that the type of transmission (manual or automatic) has zero to no impact on MPG performance. In practice, car manufacturers can ignore the type of transmission as a factor to improve MPG.

Bibliography and Notes

[1] Parker, Berry. The Isaac Newton School of Driving. The Johns Hopkins University Press. Baltimore,2003 Pp. 127

[2] The weight variable is defined as the ratio of one unit of MPG over and 1000 pounds of weight.

[3] A better model for the prediction of MPG based on the same data set can be found in: Henderson and Velleman (1981), Building multiple regression models interactively. Biometrics, 37, 391–411.